$(document).ready(function () {
   var $scrollingDiv = $("#nav a");

   $(window).scroll(function () {
	   $scrollingDiv.stop()
		   .animate({
		   "marginTop": ($(window).scrollTop() + 0) + "px"
	   }, "slow");
	   $scrollingDiv.css("color", (($(window).scrollTop() / $(document).height()) > 0.40) ? "black" : "");
   });
});